projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ddcc305
)
Handle out-of-bounds parameters in gtk_assistant_get_nth_page
author
Matthias Clasen
<mclasen@redhat.com>
Tue, 23 Feb 2010 16:23:10 +0000
(11:23 -0500)
committer
Matthias Clasen
<mclasen@redhat.com>
Tue, 23 Feb 2010 16:23:10 +0000
(11:23 -0500)
Better do what the docs say...fix by Tadej Borovšak, bug 610141.
gtk/gtkassistant.c
patch
|
blob
|
history
diff --git
a/gtk/gtkassistant.c
b/gtk/gtkassistant.c
index daec0cfe5de468aec43ad8b4c6a7f85fcd945d0d..5fd6d83d3c5c420957bd4a01d955beb66f1bff38 100644
(file)
--- a/
gtk/gtkassistant.c
+++ b/
gtk/gtkassistant.c
@@
-1615,10
+1615,14
@@
gtk_assistant_get_nth_page (GtkAssistant *assistant,
GList *elem;
g_return_val_if_fail (GTK_IS_ASSISTANT (assistant), NULL);
+ g_return_val_if_fail (page_num >= -1, NULL);
priv = assistant->priv;
- elem = g_list_nth (priv->pages, page_num);
+ if (page_num == -1)
+ elem = g_list_last (priv->pages);
+ else
+ elem = g_list_nth (priv->pages, page_num);
if (!elem)
return NULL;